package main

import (
	"fmt"
	"math/rand"
	"sort"
	"strings"
	"time"
)

type SortRuneslice []rune

func (a SortRuneslice) Len() int           { return len(a) }
func (a SortRuneslice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a SortRuneslice) Less(i, j int) bool { return a[i] < a[j] }

func homework2() {
	var builder strings.Builder
	r1 := rand.NewSource(time.Now().UnixNano())
	r2 := rand.New(r1)
	s1 := make([]rune, 0)

	for i := 3; i > 0; i-- {
		a := rune(r2.Intn(26) + 97)
		builder.WriteRune(a)
		s1 = append(s1, a)

	}
	fmt.Println(builder.String())
	fmt.Println(s1)
	sort.Sort(SortRuneslice(s1))
	fmt.Println(s1)

}
